package com.glory.cqaospda.viewmodel

import com.glory.cqaospda.model.TaskRepository
import com.glory.mvvmnet.base.BaseViewModel
import com.glory.mvvmnet.entity.CallObserveBean
import com.google.gson.JsonObject

class PmModel :BaseViewModel() {

    private val repository by lazy { TaskRepository() }

    fun defaultPM(map: JsonObject){

        launchOnlyResult({

            repository.defaultPM(map,"EMS_PM")
            defUI.callObserve.value = CallObserveBean(2)
        })
    }

    fun defaultGetPmEqpStatus(eqpID: String) {
        val map = JsonObject()
        map.addProperty("EquipmentName", eqpID)
        launchOnlyResult({
            val pMStatus =
                repository.defaultGetPMStatus(map,"EMS_GetPMStatus")
            defUI.callObserve.value = CallObserveBean(1,pMStatus)
        })
    }

}